<template>
	<el-table :data="week" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
		class="w-full" border>
		<el-table-column prop="label" :label="$t('machine.trade.week')" />
		<el-table-column prop="open" :label="type == 1 ? $t('date.closeHours') : $t('date.closTime')" />
		<el-table-column prop="close" :label="type == 1 ? $t('date.businessHours') : $t('date.startTime')" />
	</el-table>
	<div class="mt-4 text-right">
		<el-button type="danger" @click="cleanup">{{ $t('machine.trade.clearConfig') }}</el-button>
	</div>
</template>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
const { t: $t } = useI18n()
let emit = defineEmits(['tradebtn'])
let props = defineProps({
	week: {
		type: Array,
		default: []
	},
	type: {
		type: Number,
		default: 1
	}
})

let cleanup = () => {
	emit('tradebtn')
}

</script>